Skip to content

fix(sandbox): require https for daytona signed preview URLs#3206

Closed
adityasingh2400 wants to merge 1 commit into
openai:mainfrom
adityasingh2400:fix/daytona-https-preview
Closed

fix(sandbox): require https for daytona signed preview URLs#3206
adityasingh2400 wants to merge 1 commit into
openai:mainfrom
adityasingh2400:fix/daytona-https-preview

Conversation

@adityasingh2400
Copy link
Copy Markdown
Contributor

Summary

DaytonaSandboxSession._resolve_exposed_port accepted any URL returned by create_signed_preview_url — including http://... — and silently exposed it as a non-TLS endpoint (tls=False, port 80). Daytona signed preview URLs are always HTTPS, so a non-https scheme indicates either a backend bug or a tampered response. Either way, downstream code would then connect over plaintext to a host derived from that URL.

This change rejects any preview URL whose scheme is not https, raising ExposedPortUnavailableError with the existing invalid_preview_url detail (same path already used for malformed URLs).

This is in the same vein as #3094 / #3172 / #3177 — defensive narrowing of what a sandbox backend will trust from the wire.

Diff

  • src/agents/extensions/sandbox/daytona/sandbox.py: 4 lines changed (require https, drop the http fallback for tls/port).
  • tests/extensions/sandbox/test_daytona.py: new test_resolve_exposed_port_rejects_non_https_preview_url covering the regression.

Test plan

  • New unit test test_resolve_exposed_port_rejects_non_https_preview_url fails on main and passes after the fix.
  • Full tests/extensions/sandbox/test_daytona.py suite (54 tests) passes.
  • ruff check and ruff format --check clean on both files.

🤖 Generated with Claude Code

Daytona signed preview URLs are always HTTPS. Treat any non-https scheme
as an invalid preview URL instead of silently downgrading to plaintext
(tls=False, port 80), which would expose the user's exposed-port traffic
over an unauthenticated, unencrypted channel if the backend ever returned
an http URL.
@seratch
Copy link
Copy Markdown
Member

seratch commented May 8, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@seratch
Copy link
Copy Markdown
Member

seratch commented May 8, 2026

This could make sense, but I don't see the necessity to do this on the client SDK side

@seratch seratch closed this May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants